#!/usr/bin/python3
# -*- coding: utf-8 -*-#
# -------------------------------------------------------------------------------
# Name:         user_state
# Description:  用户状态
# Author:       牛泽鹏
# Date:         2019/7/17
# -------------------------------------------------------------------------------
from users.models import UserInfo


def get_user_state(request):
    try:
        user_obj = UserInfo.objects.get(pk=request.session.get('user_id'))
    except UserInfo.DoesNotExist:
        user_obj = None
    return {
        'user_obj': user_obj
    }
